package funcs

import (
	"git.oschina.net/gunsluo/hawkeye-common/cron"
	"git.oschina.net/gunsluo/hawkeye-common/g"
	"git.oschina.net/gunsluo/hawkeye-common/model"
)

/*
	Description: 函数功能
	1、按model中数据模型构建数据
	2、实现单次采集数据函数

	Author: jerrylou, <gunsluo@gmail.com>
	Since:  2016/08/25
*/
func BuildMappers() {

	interval := g.Config().Agent.Interval
	var mappers []model.FuncsAndInterval = []model.FuncsAndInterval{
		model.FuncsAndInterval{
			Fs: []func() []*model.MetricValue{
				Example1Metrics,
				Example2Metrics,
			},
			Interval: interval,
		},
		model.FuncsAndInterval{
			Fs: []func() []*model.MetricValue{
				Example3Metrics,
			},
			Interval: interval,
		},
	}

	// 将采集接口赋值给定时器 2016/08/25 Add by jerrylou
	cron.Mappers(mappers)
}
